<template>
    <div class="Search">
        <input @blur="blur"
               v-model="SearchInput"
               class="Search-input"
               placeholder="搜索"/>
    </div>
</template>

<script>
    export default {
        name: "IndexSearch",
        data(){
            return{
                SearchInput:"",
                SearchList:[]
            }
        },
        methods:{
            //搜索框取消聚焦
            blur(){
                if(this.SearchInput!=""){
                    this.$router.push('/Search/'+this.SearchInput)
                }
            },

        }

    }
</script>

<style scoped>
    .Search{
        display: flex;
        width: 100%;
        background-color: #f6f6f6;
        height: 44px;
    }
    .Search-input{
        width: 90%;
        height: 30px;
        text-align: center;
        margin: auto auto;
        /*border-color: white;*/
        border: 1px solid #f6f6f6;
        border-radius: 20px;
    }
</style>